﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.IO;

namespace BDShop.Configuration
{
    public class StorageElement:ConfigurationElement
    {
        [ConfigurationProperty("AdminStorageFolder")]
        protected string AdminStorageFolder
        {
            get { return (string)this["AdminStorageFolder"]; }
        }

        [ConfigurationProperty("StorageFolder")]
        public string StorageFolder
        {
            get { return (string)this["StorageFolder"]; }
        }

        [ConfigurationProperty("ImagePath")]
        public string ImagePath
        {
            get { return (string)this["ImagePath"]; }
        }

        public string CachePathBO
        {
            get { return Path.Combine(AdminStorageFolder, "Caches"); }
        }

        public string CachePathFO
        {
            get { return Path.Combine(StorageFolder, "Caches"); }
        }

        public string MainImagePath
        {
            get { return Path.Combine(ImagePath, "Product"); }
        }

        public string ImageSliderPath
        {
            get { return Path.Combine(ImagePath, "Slider"); }
        }
    }
}
